package guowei.guliproduct.product.web;

import guowei.guliproduct.product.entity.CategoryEntity;
import guowei.guliproduct.product.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestSpringCache {

    @Autowired
    private CategoryService categoryService;

    /**
     * @Cacheable: Triggers cache population.  触发将数据保存到缓存的操作
     *
     * @CacheEvict: Triggers cache eviction.   触发从缓存中删除数据的操作
     *
     * @CachePut: Updates the cache without interfering with the method execution.  不影响方法执行更新缓存
     *
     * @Caching: Regroups multiple cache operations to be applied on a method.      组合以上多个操作
     *
     * @CacheConfig: Shares some common cache-related settings at class-level.      在类级别下共享缓存的相同配置
     *
     *
     *      *  1.指定生成的key
     *      *  2.指定生成key的存活时间      配置文件中
     *      *  3.指定生成value的序列化机制   默认jdk的序列化机制，要转为json格式 配置RedisCacheConfiguration组件
     */

}
